import axios from "./serviceHelper";

// 图片上传
export const getResourceApi = (params) => axios.post(`/resource`, params).then((res) => res);

// 密码登陆
export const loginPwdApi = (params) => axios.post(`/c/main/login`, params).then((res) => res);

// 短信验证码
export const smsCodeApi = (params) => axios.post(`/sms/code`, params).then((res) => res);

// 短信登陆
export const loginSmsApi = (params) => axios.post(`/c/main/loginSms`, params).then((res) => res);

// 获取用户信息
export const getAccountApi = (params) => axios.get(`/c/account`, params).then((res) => res);

// 注册
export const registerApi = (params) => axios.post(`/c/main/register`, params).then((res) => res);

// 获取首页信息
export const getHomeApi = (params) => axios.get(`/c/home`, params).then((res) => res);

// 地址管理
export const getAddressApi = (params) => axios.get(`/c/address`, params).then((res) => res);
export const addAddressApi = (params) => axios.post(`/c/address`, params).then((res) => res);
export const updateAddressApi = (params) => axios.put(`/c/address`, params).then((res) => res);
export const delAddressApi = (params) => axios.delete(`/c/address/` + params.id, {}).then((res) => res);

// 空间记录
export const getSpaceApi = (params) => axios.get(`/c/account/space`, params).then((res) => res);

// 实名认证
export const realNameApi = (params) => axios.put(`/c/account/realName`, params).then((res) => res);

// 提现管理
export const getWithdrawApi = (params) => axios.get(`/c/cash`, params).then((res) => res);
export const addWithdrawApi = (params) => axios.post(`/c/cash`, params).then((res) => res);

// 收益查询
export const getIncomeApi = (params) => axios.get(`/c/account/earnings`, params).then((res) => res);
